//  this library.

import 'package:hktk_app/util/dao_util.dart';

class LiveDao {
  // 获取直播列表
  static Future<dynamic> getLiveList(
      {required String columnId, required int categoryId}) async {
    final String url =
        '/kc/course/live/live-by-columnId?columnId=${columnId}&categoryId=${categoryId}';
    // return HotSharedModel.fromJson(data);

    return await httpGET(url: url, tips: "");
  }

  static Future<dynamic> getVideoList([int pageNum=1,int pageSize=3]) async {
    final String url = '/kc/course/live/videoList';
    // return HotSharedModel.fromJson(data);
   return httpGET1(url: url,params: {
     "pageNum":pageNum.toString(),
     "pageSize":pageSize.toString(),
   }, tips: "").catchError((onError){
     return {
       "records":[]
     };
   });

  }

  static Future<dynamic> haveAppoint({required String liveId}) async {
    final String url = '/kc/course/live/haveAppoint?liveId=${liveId}';
    // return HotSharedModel.fromJson(data);
    return await httpGET(url: url, tips: "");
  }

  static Future<dynamic> appoint(String liveId) async{
    final String url = "/kc/course/live/appoint";
    return await httpPOST(url: url, params: {"liveId": liveId});
  }
}
